import DialogUtil from '@/DialogUtil';
import PlayerUtil from '@/PlayerUtil';

declare global {
    var game_hard_level: number;
}

export default class GameHardLevel {
    static 提示框: dialog;
    static 间隔提示框: dialog;
    constructor() {
        game_hard_level = 0;
        GameHardLevel.显示难度选择();
    }
    static 显示难度选择() {
        let arr: string[] = [
            '|cff9b9b9b宝宝：怪物生命-50%，伤害-50%|r',
            '|cff14fc7c新手：怪物生命-25%，伤害-25%',
            '|cff01b327正常：怪物生正常，伤害正常',
            '|cff07f3df老手：怪物生命+25%，伤害+25%',
            '|cff0286d3硬核：怪物生命+50%，伤害+50%',
            '|cff8a42fd疯狂：怪物生命+75%，伤害+75%',
            '|cffeb1c1c变态：怪物生命+100%，伤害+100%',
        ];
        GameHardLevel.提示框 = DialogUtil.show(0, '选择难度', GameHardLevel.点击难度按钮, ...arr);
    }
    static 点击难度按钮(index: number, text: string) {
        PlayerUtil.message('|cffff0000玩家1|r选择了难度：' + text);
        // 难度选择完毕
        game_hard_level = index + 1;
        // se.emit('难度选择完毕');
        GameHardLevel.选择出怪间隔();
    }
    static 选择出怪间隔() {
        let arr: string[] = ['|cff01b327出怪间隔 90 秒', '|cff0286d3出怪间隔 60 秒', '|cff8a42fd出怪间隔 30 秒'];
        GameHardLevel.间隔提示框 = DialogUtil.show(0, '选择出怪间隔', GameHardLevel.间隔点击, ...arr);
    }
    static 间隔点击(index: number, text: string) {
        game_wave_interval = 120 - (index + 1) * 30;
        PlayerUtil.message('|cffff0000玩家1|r选择的出怪间隔为：' + game_wave_interval + `秒,将于|cffffff00${game_wave_interval}秒|r后开始刷怪，请各位玩家做好准备`);
        se.emit('GAME_HARD_SELECTED');
    }
}
